$(function () {
    $("#increase_city_btn").click(function () {
        var  id=Math.ceil(Math.random()*1000);
        var cityname = document.getElementById("increase_city_cityName").value;
        var describetion = document.getElementById("increase_city_describetion").value;
        console.log(cityname);


        if( increase_city_describetion!=""&&increase_city_cityName!="") {

            $.ajax({
                    type: 'post',
                    url:"http://39.108.233.68:8080/insOneCity" ,
                    data: {
                        id:id,
                        cityname:cityname,
                        describetion:describetion,

                    },
                    datatype: 'json',
                    success: function (data) {

                        alert("成功增加城市！");
                    },
                    error: function () {
                        alert("error");
                    }
                }
            )
        }


        else {
            alert("所有内容均不能为空！")
        }
    })
})
